home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / tex / dvi / dvipssrc.zoo / scripts / maketexp next >
Text File  |  1991-01-26  |  2KB  |  109 lines

  1. #!/bin/sh
  2. #
  3. #   This script file makes a new TeX PK font, because one wasn't
  4. #   found.  Parameters are:
  5. #
  6. #   name dpi bdpi magnification [mode]
  7. #
  8. #   `name' is the name of the font, such as `cmr10'.  `dpi' is
  9. #   the resolution the font is needed at.  `bdpi' is the base
  10. #   resolution, useful for figuring out the mode to make the font
  11. #   in.  `magnification' is a string to pass to MF as the
  12. #   magnification.  `mode', if supplied, is the mode to use.
  13. #
  14. #   Note that this file must execute Metafont, and then gftopk,
  15. #   and place the result in the correct location for the PostScript
  16. #   driver to find it subsequently.  If this doesn't work, it will
  17. #   be evident because MF will be invoked over and over again.
  18. #
  19. #   Of course, it needs to be set up for your site.
  20. #
  21. # TEMPDIR needs to be unique for each process because of the possibility
  22. # of simultaneous processes running this script.
  23. DESTDIR=/LocalLibrary/Fonts/TeXFonts/pk
  24. TEMPDIR=/tmp/mtpk.$$
  25. NAME=$1
  26. DPI=$2
  27. BDPI=$3
  28. MAG=$4
  29. MODE=$5
  30.  
  31. umask 0
  32.  
  33. if test "$MODE" = ""
  34. then
  35.    if test $BDPI = 300
  36.    then
  37.       MODE=imagen
  38.    elif test $BDPI = 400
  39.    then
  40.       MODE=nexthi
  41.    elif test $BDPI = 100
  42.    then
  43.       MODE=nextscreen
  44.    elif test $BDPI = 635
  45.    then
  46.       MODE=linolo
  47.    elif test $BDPI = 1270
  48.    then
  49.       MODE=linohi
  50.    elif test $BDPI = 2540
  51.    then
  52.       MODE=linosuper
  53.    else
  54.       echo "I don't know the mode for $BDPI"
  55.       echo "Have your system admin update MakeTeXPK"
  56.       exit 1
  57.    fi
  58. fi
  59.  
  60. #  Something like the following is useful at some sites.
  61. # DESTDIR=/usr/local/lib/tex/fonts/pk.$MODE
  62. GFNAME=$NAME.$DPI'gf'
  63. PKNAME=$NAME.$DPI'pk'
  64.  
  65. # Clean up on normal or abnormal exit
  66. trap "cd /; rm -rf $TEMPDIR $DESTDIR/pktmp.$$" 0 1 2 15
  67.  
  68.  
  69. if test ! -d $DESTDIR
  70. then
  71.    mkdir $DESTDIR
  72. fi
  73.  
  74. mkdir $TEMPDIR
  75. cd $TEMPDIR
  76.  
  77. if test -r $DESTDIR/$PKNAME
  78. then
  79.    echo "$DESTDIR/$PKNAME already exists!"
  80.    exit 0
  81. fi
  82.  
  83. # check also in the standard place
  84.  
  85. if test -r /usr/lib/tex/fonts/pk/$PKNAME
  86. then
  87.    echo /usr/lib/tex/fonts/pk/$PKNAME already exists!
  88.    exit 0
  89. fi
  90.  
  91. echo mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" \\\</dev/null
  92. mf "\mode:=$MODE; mag:=$MAG; scrollmode; input $NAME" </dev/null
  93. if test ! -r $GFNAME
  94. then
  95.    echo "Metafont failed for some reason on $GFNAME"
  96.    exit 1
  97. fi
  98.  
  99. gftopk $GFNAME $PKNAME
  100.  
  101. # Install the PK file carefully, since others may be doing the same
  102. # as us simultaneously.
  103.  
  104. mv $PKNAME $DESTDIR/pktmp.$$
  105. cd $DESTDIR
  106. mv pktmp.$$ $PKNAME
  107.  
  108. exit 0
  109.